﻿<?php
$username = "root";
$password = "m1tk01239";
$hostname = "localhost";	
$dbh = mysql_connect($hostname, $username, $password) 
	or die("Връзката с MYSQL не може да бъде осъществена!");
	//or die("Сайтът е спрян за профилактика.");
$selected = mysql_select_db("wowp",$dbh) 
	or die("Не съществува база данни с името „wowp“");
$loggedInUser = $_COOKIE['username'];
$selUser = mysql_query("SELECT * FROM users WHERE username='$loggedInUser'");
$user = mysql_fetch_assoc($selUser);
date_default_timezone_set('Europe/Sofia');
	//	Ако няма откъде да го взема, ползвам един от двата реда долу:
	//	mysql_query("SET NAMES cp1251", $dbh);
	//	mysql_query("SET NAMES utf8", $dbh);
function header3($title,$selected) { /*?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
	<title><?php if($title != NULL) { echo $title.' — '; } ?>Wizards of Waverly Place Fansite</title>
	<link type="text/css" rel="stylesheet" href="css/mainStyle.css" />
	<link type="text/css" rel="stylesheet" href="css/percentBar.css" />
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>

<body>
<div id="fullScreenNav">
<table width="100%">
<tr>
	<td width="259"><div id="logoNew"></div></td>
	<td class="notLogo">
		<ul id="mainMenu" maxlength="250">
			<li <?php if($selected=="index") { echo 'class="active"'; } ?>><a href="index.php">Начало</a></li>
			<!--<li <?php if($selected=="episodes") { echo 'class="active"'; } ?>><a href="">Епизоди</a></li>
			<li <?php if($selected=="movies") { echo 'class="active"'; } ?>><a href="">Филми</a></li>
			<li <?php if($selected=="help") { echo 'class="active"'; } ?>><a href="">Помощ</a></li>-->
			<li <?php if($selected=="stats") { echo 'class="active"'; } ?>><a href="stats.php">Статистики</a></li>
			<li <?php if($selected=="testvideo") { echo 'class="active"'; } ?>><a href="video.php?name=justins-back-in">Тест видео</a></li>
			<li <?php if($selected=="changelog") { echo 'class="active"'; } ?>><a href="changelog.php">Промени</b></a></li>
			<?php if($selected=='diff') { ?><li class="active"><a href=""><?=$title;?></a></li><?php } ?>
		</ul>
	</td>
	<td width="250" id="searchBox">
		<form id="search" action="../search.php" method="post" style="display: inline;margin:0;padding:0;">
		<input type="text" name="keywords" placeholder="Търси из сайта…" />
		<button type="submit"><span style="display:none;">Давай</span></button>
		</form>
	</td>
	<td width="" class="notLogo">
	<div id="user">
		<div id="userPicture"></div><div id="userName">Mitko1239&nbsp;&nbsp;<img src="i/msg.gif">&nbsp;0&nbsp;&nbsp;<span style="color: #111;">[</span><b>изход</b><span style="color: #111;">]</span></div>
	</div>
	</td>
</tr>
</table>
</div>
<?php */} function header31($title,$selected) {
?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
	<title><?php if($title != NULL) { echo $title.' — '; } ?>Title</title>
	<link type="text/css" rel="stylesheet" href="css/mainStyle.css" />
	<link type="text/css" rel="stylesheet" href="css/percentBar.css" />
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<style>
		#header-3-1 {width:100%;margin: 0 auto;}
		#userArea-3-1 {height:20px;background: #333;border-radius: 10px;border-bottom-left-radius: 0;border-bottom-right-radius: 0;padding:5px;margin-right: 0px;color:white;margin-top: 20px;}
		#menuBox {margin: 0;padding:0;}
		#menuBox li {display: inline;margin-right: 5px;}
		#menuBox a {color: #fff;text-decoration:none;}
	</style>
</head>

<body>
<div id="header3-1" style="">
	<div idDA="logoNew" style="float:left;">Title</div>
	<div id="userArea-3-1" style="float:right;">
		<span style="line-height: 20px;">
			<img src="i/time.png" width="16" height="16" />&nbsp;<span title="<?php echo date('l, d F Y', time())?>"style="color:white;"><?php echo date('H:i', time())?></span>&nbsp;&nbsp;<span title="3 нови епизода от последното Ви влизане"><img src="i/new.png" width="16" height="16" />&nbsp;3</span>&nbsp;&nbsp;<img src="i/user.png" />&nbsp;Mitko1239&nbsp;&nbsp;<img src="i/msg.gif" />&nbsp;255&nbsp;&nbsp;[изход]
		</span>
	</div>
	<div style="clear:both;"></div>
	
	<div id="navigationAndSearch" style="line-height: 40px;">
		<div id="navigation" style="float:left;padding-left: 10px;">
			<ul id="menuBox">
			<?php $finished=0; if($finished==0) { ?>
				<li <?php if($selected=="index") { echo 'class="active"'; } ?>><a href="index.php">Начало</a></li>
				<li <?php if($selected=="stats") { echo 'class="active"'; } ?>><a href="stats.php">Статистики</a></li>
				<li <?php if($selected=="testvideo") { echo 'class="active"'; } ?>><a href="video.php?name=justins-back-in">Тест видео</a></li>
				<li <?php if($selected=="changelog") { echo 'class="active"'; } ?>><a href="changelog.php">Промени</b></a></li>
				<?php if($selected=='diff') { ?><li class="active"><a href=""><?=$title;?></a></li><?php } ?>
			<?php } elseif($finished==1) { ?>
				<li <?php if($selected=="index") { echo 'class="active"'; } ?>><a href="index.php">Начало</a></li>
				<li <?php if($selected=="episodes") { echo 'class="active"'; } ?>><a href="">Епизоди</a></li>
				<li <?php if($selected=="movies") { echo 'class="active"'; } ?>><a href="">Филми</a></li>
				<li <?php if($selected=="downloads") { echo 'class="active"'; } ?>><a href="">За сваляне</li>
				<li <?php if($selected=="stats") { echo 'class="active"'; } ?>><a href="stats.php">Статистики</a></li>
				<li <?php if($selected=="help") { echo 'class="active"'; } ?>><a href="">Помощ</a></li>
				<li <?php if($selected=="admins") { echo 'class="active"'; } ?>><a href="">Администраторска зона</a></li>
				<?php if($selected=='diff') { ?><li class="active"><a href=""><?=$title;?></a></li><?php } ?>
			<?php } ?>
			</ul>
		</div>
		<div id="searchBox" style="float:right;padding-right: 10px;">
			<form id="search" action="../search.php" method="post" style="display: inline;margin:0;padding:0;">
			<input type="text" name="keywords" placeholder="Търси из сайта…" />
			<button type="submit"><span style="display:none;">Давай</span></button>
			</form>
		</div>
		<div style="clear:both;"></div>
	</div>
</div>
<div id="content31" style="width:98.4%">
<?php } function footer3() { ?>
</div>
<table id="footerAlt" border="0">
<tr>
<td width="80%">Wizards' Place WORK IN PROGRESS &bull; 2011 &copy; Всички права запазени от MProductions</td>
<td width="20%"><a style="color:black;text-decoration:none;" href="changelog.php">Версия <b>0.0.1</b> от <b>15 декември 2011г.</b></a></td>
</tr>
</table>

</body>

</html>
<?php } ?>